package cn.wang.controller;

import cn.wang.common.vo.PageResult;
import cn.wang.pojo.Goods;
import cn.wang.pojo.SearchRequest;
import cn.wang.pojo.SearchResult;
import cn.wang.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Controller
public class SearchController {

    @Autowired
    GoodsService goodsService;

    @PostMapping("/page")
    public ResponseEntity<SearchResult> searchPage(@RequestBody SearchRequest request){
        return ResponseEntity.ok(goodsService.searchPage(request));
    }
}
